package net.modul.customer.action;

import java.util.ArrayList;
import java.util.List;

import net.common.action.GeneralAction;
import net.modul.customer.service.CustOrgDeleteService;
import net.modul.customer.service.CustOrgEditorService;
import net.modul.customer.service.CustOrgFindService;
import net.modul.customer.service.CustOrgSearchService;
import net.modul.customer.vo.CustOrgVo;

public class CustOrgAction extends GeneralAction {

	private static final long serialVersionUID = 7127573666355745443L;

	private CustOrgVo bean = new CustOrgVo();
	private List<CustOrgVo> list = new ArrayList<CustOrgVo>();
	
	public String search() throws Exception {
		CustOrgSearchService service = new CustOrgSearchService();
		service.setBean(bean);
		service.setPageBean(pageBean);
		service.invoke();
		list = service.getList();
		return SUCCESS;
	}
	
	public String editor() throws Exception {
		CustOrgEditorService service = new CustOrgEditorService();
		service.setBean(bean);
		service.invoke();
		return SUCCESS;
	}
	
	public String find() throws Exception {
		if(bean.getOrg_id() != null) {			
			CustOrgFindService service = new CustOrgFindService();
			service.setId(bean.getOrg_id());
			service.invoke();
		}
		return SUCCESS;
	}
	
	public String delete() throws Exception {
		CustOrgDeleteService service = new CustOrgDeleteService();
		service.setBean(bean);
		service.invoke();
		return SUCCESS;
	}
	
	public CustOrgVo getBean() {
		return bean;
	}
	public void setBean(CustOrgVo bean) {
		this.bean = bean;
	}
	public List<CustOrgVo> getList() {
		return list;
	}
	public void setList(List<CustOrgVo> list) {
		this.list = list;
	}
}
